Feat(text tool): Add import custom fonts#9091
Conversation
…t-custom-fonts # Conflicts: # invokeai/app/api/routers/utilities.py # invokeai/app/services/config/config_default.py # invokeai/frontend/web/public/locales/en.json # invokeai/frontend/web/src/services/api/endpoints/utilities.ts
|
@Pfannkuchensack What changed:
On the auth question: this router is not mounted behind a parent FastAPI dependency. Confirmed: I addressed that by making custom font availability reactive:
So this is no longer relying on an implicit re-render path. |
…com/DustyShoe/InvokeAI into Feat(Text-tool)/import-custom-fonts
As stated in PR description this implementation only loads custom fonts from the host-managed
|
Added. I documented the custom font workflow in:
The docs now cover:
|
Agreed on the general direction, but this PR does not currently pick the lightest weight. Right now the backend collapses a family to a single dropdown entry by preferring:
So the representative face is intended to be the regular/default face, not the thinnest one. The family's discovered faces are still returned separately in the API and used for normal/bold/italic loading. A full variable-font weight/thickness control would be follow-up work. It would need:
I kept this PR scoped to importing and using custom font families within the existing text tool controls. |
|
I recommend that paths not have spaces and stick to the lowercase convention |
Updated in this PR. The custom font directory is now lowercase |
Great! Does this allow for a custom path via |
I did not include it here because it adds another persistent config surface, and I am not sure it is worth doing right now given the planned UI/tooling refactor unless there is a concrete use case for a non-default font directory. |
…com/DustyShoe/InvokeAI into Feat(Text-tool)/import-custom-fonts # Conflicts: # tests/app/routers/test_utilities.py
…t-custom-fonts # Conflicts: # invokeai/app/util/custom_openapi.py
…ort-custom-fonts # Conflicts: # invokeai/frontend/web/src/features/controlLayers/components/Text/CanvasTextOverlay.tsx # invokeai/frontend/web/src/features/controlLayers/components/Text/TextToolOptions.tsx # uv.lock
…ort-custom-fonts # Conflicts: # tests/app/routers/test_utilities.py # uv.lock

Summary
Add support for custom text-tool fonts loaded from
invokeai/Fonts.This feature lets users add their own font files without replacing the built-in font set. The backend now discovers and serves fonts from
invokeai/Fonts, creates the directory andREADME.txtautomatically, and parses font metadata to show clean family names. The frontend loads these fonts into the text tool, shows them separately from built-in fonts, and keeps built-in fonts as fallback when no custom fonts are available.Related Issues / Discussions
N/A
QA Instructions
.ttf,.otf,.woff, or.woff2files toinvokeai/Fontsinvokeai/Fontsis emptyinvokeai/frontend/web/src/services/api/schema.tswas regenerated after adding the new utilities endpointsMerge Plan
Standard merge.
Checklist
What's Newcopy (if doing a release after this PR)